
<!DOCTYPE html>
<html lang="zh-CN">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- 上述3个meta标签*必须*放在最前面，任何其他内容都*必须*跟随其后！ -->
    <meta name="description" content="">
    <meta name="author" content="">
    <link rel="icon" href="../../favicon.ico">

    <title>我做的留言板</title>

    <!-- Bootstrap core CSS -->
    <link href="./Tpl/css/bootstrap.min.css" rel="stylesheet">

    
  </head>

  <body>
    <div class="container">
        <div class="navbar-header">
          <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
            <span class="sr-only">Toggle navigation</span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
          </button>
          <a class="navbar-brand" href="#">留言板</a>
        </div>
        <div id="navbar" class="navbar-collapse collapse">
          <form class="navbar-form navbar-right">
            <div class="form-group">
              <input type="text" placeholder="QQ账号" class="form-control">
            </div>
            <div class="form-group">
              <input type="password" placeholder="输入密码" class="form-control">
            </div>
            <button type="submit" class="btn btn-success">登录</button>
          </form>
        </div>
      </div>
    <div class="container">

      <div class="row row-offcanvas row-offcanvas-right">

        <div class="col-xs-12 col-sm-9">
          <p class="pull-right visible-xs">
            <button type="button" class="btn btn-primary btn-xs" data-toggle="offcanvas">Toggle nav</button>
          </p>
          <?php foreach ($db as $k => $v) {?>
                      <div class="alert alert-success" role="alert">
                        <strong><?php echo $v['username'] ?>：</strong> <?php echo $v['content'] ?>
                        (<?php echo aaa($v['create_time']) ?>)
                        <a href="./del.php?id=<?php echo $k ?>"class="btn btn-danger btn-xs">删除</a>
                        <a href="./dit.php?id=<?php echo $k ?>" class="btn btn-warning btn-xs">修改</a>
                      </div>
         <?php } ?>    
         <nav aria-label="...">
            <ul class="pagination">
            <?php if ($p!=1) {?>
              <li><a href="./index.php?p=<?php echo $p-1?>" aria-label="Previous"><span aria-hidden="true">上一页</span></a></li>
           <?php }?>
 
               <?php for ($i=1; $i <=$page ; $i++) { ?>
                 
              <li class="<?php if ($p==$i) {
                echo "active";
              }   ?>">
                <a href="./index.php?p=<?php echo $i ?>"><?php echo $i; ?>
                      <span class="sr-only"></span>
                </a>
              </li>
              <?php }?>
               <?php if($p!=$page){?>
                <li>
                  <a href="./index.php?p=<?php echo $p+1?>" aria-label="Next">
                    <span aria-hidden="true">
                           下一页
                    </span>
                  </a>
                </li>
               <?php }?>
                
             
           </ul>
         </nav>
          <div class="row" style="padding-top:80px">

            <form action="./add.php" method="post"  class="form-inline">
              <div class="form-group">
                <label  class="sr-only"  for="exampleInputAmount">大虾有何指教</label>
                <div class="input-group">
                  <div class="input-group-addon">用户名</div>
                  <input type="text" class="form-control" name="username" id="exampleInputAmount" placeholder="大虾有何指教?">  
                </div>
              </div>
              <button type="submit" class="btn btn-primary">留言</button>
              <br>
              <textarea style="margin-top:20px; width:100%" name="content" class="form-control" rows="3" ></textarea>
            </form>
          </div><!--/row-->
        </div><!--/.col-xs-12.col-sm-9-->
      </div><!--/row-->

      <hr>

      <footer>
        <p>&copy; Company 2014</p>
      </footer>

    </div><!--/.container-->  
  </body>
</html>
